package com.dragon.app.commons.service;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.dragon.app.commons.constant.ErrorCode;
import com.fintech.common.vo.FintechResult;
import com.marvels.common.exception.MarvelsBusinessException;
import com.marvels.common.utils.MarvelsLogUtil;
import com.marvels.system.common.service.SysConfigService;

/**
 * app配置
 * @author 唐佩文
 *
 */
@Service("appConfigService")
public class AppConfigServiceImpl implements AppConfigService{
	@Autowired
	private SysConfigService sysConfigService;
	
	public FintechResult appRevealConfigure(){
		/*FintechResult jsonResult = newMarvelCoreService.getForObjectPost(MarvelURLConstant.SYSTEM_SERVICE_APPREVEALCONFIGURE, null);*/
		FintechResult jsonResult = new FintechResult();
		try {
			Map<String,Object> map = sysConfigService.appRevealConfigure(null);
			jsonResult.setErrorCode(ErrorCode.SUCCESS);
			jsonResult.setData(map);
		} catch (MarvelsBusinessException e) {
			jsonResult.setErrorCode(ErrorCode.FAIL);
		}
		
		MarvelsLogUtil.getInstance().info("========appRevealConfigure:" + JSON.toJSONString(jsonResult));
		if (!ErrorCode.SUCCESS.equals(jsonResult.getErrorCode())) {
			return FintechResult.getFailResult(ErrorCode.FAIL, "获取app配置失败");
		}
		return FintechResult.getResult(ErrorCode.SUCCESS, "操作成功", jsonResult.getData());
	}
}
